﻿@model Applica.Models.SponsorInputs345xModel 
<div class="welcome_tab">
    <div class="left_part">
        <h4>Welcome Screen</h4>
        <div class="welcome_img_phone">
            <img src="@Url.Content("~/images/welcome_img_phone.png")" alt=""  class="phoneImageWelcome"/>
            <img style="display: none" src="@Url.Content("~/images/mobileApp/screenshots android/welcome-android.png")" alt=""  class="phoneImageWelcome"/>
            <img src="@Url.Content("~/images/mobileApp/see as android.png")" alt=""  class="phoneImageWelcome1 phoneImageandroid"/>
            <img style="display: none" src="@Url.Content("~/images/mobileApp/see as iphone.png")" alt=""  class="phoneImageWelcome1 phoneImageandroid"/>
            <script>
                $(".phoneImageWelcome1").click(function () {
                    $(".phoneImageWelcome1").toggle();
                    $(".phoneImageWelcome").toggle();
                });
            </script>
        </div>
    </div>
    <div class="right_part">
        <p>
            The Welcome screen is what your customers will see every time they re-open your
                                        version of the Home Wizard app. They will also see your branding info on your app's 
                                        confirmation screen whenever they change their
                                        personalization or when they add additional home.
                                       
        </p>
        <div id="spnMessagewelcome"></div>

        <div class="up_data">
            <div class="up_data-img-upload">
                <label>IMAGE</label></div>
            <div class="upload-image-div">
                   <div class="user_img-l">
                

                    <img id="imglogo" src='@Url.Content("~/sponsor_iphone_images/" + Model.ilogo_pic)' alt="" />
                   
            </div>

                <div class="img-upload-data">
                <div class="upload_btn">

                    <input id="fileupload" type="file" name="files[]" multiple>
                </div>
                <div class="progress">
                    <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
                        <span class="sr-only">0% complete</span>
                    </div>
                </div>
                     @if (Model.ilogo_pic=="Default.png")
            {
                @:<div id="divRestore" style="display: none">
            } 
            else
            {
                @: <div id="divRestore" style="display: block">
            }

            <span class="image-save">Image saved</span>
                
                 @using (Ajax.BeginForm("restoreFile", "Iphone", new AjaxOptions
                 {
                     HttpMethod = "POST",
                     LoadingElementId = "loaderdefaultimage",
                     InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
                     UpdateTargetId = "data",
                     OnSuccess = "OnSuccessDefault"

                 }))
                 { 
                    @Html.HiddenFor(model => model.Sponsor_ID)
                <span id="data" > </span>
                     <a class=".sendmail" style="text-decoration:underline;color:red;" href="#" id="btnDefaultImageRestore">restore default image</a>@*
                   <input type="submit" value="Restore default image" id="btnDefaultImageRestore"/>*@  <div style="display: none" id="loaderdefaultimage">
                <img src="@Url.Content("~/images/ajax-loader.gif")" /></div>
                      
                 }
                <script>
                    function OnSuccessDefault(data) {
                        // alert(data.name);
                        $("#imglogo").attr("src", '../sponsor_iphone_images/' + data.name);
                        $("#divRestore").css("display", "none");
                    }

                </script>

            </div>

                </div>
            
            <style>


                .progress-bar {
    background-image: linear-gradient(to bottom, #428BCA 0px, #3071A9 100%);
    background-repeat: repeat-x;
}
 .sr-only {
    border: 0 none;
    clip: rect(0px, 0px, 0px, 0px);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}
 .progress-bar {
    background-color: #428BCA;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15) inset;
    color: #FFFFFF;
    float: left;
    font-size: 12px;
    height: 100%;
    text-align: center;
    transition: width 0.6s ease 0s;
    width: 0;
}
 .progress {
    background-image: linear-gradient(to bottom, #EBEBEB 0px, #F5F5F5 100%);
    background-repeat: repeat-x;
}
.progress {
    background-color: #F5F5F5;
    border-radius: 4px 4px 4px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
    height: 20px;
    margin-bottom: 10px;
    margin-top: 10px;
    overflow: hidden;
}
            </style>
           
            <div class="img-upload-data">
              
                <div>
                

              <div style="display:none"> <div class="file_name"></div>

                <div class="file_type"></div>

                <div class="file_size"></div>
                <div class="file_imglogo"></div></div> 
           
           
</div> </div>
            
        </div><div class="info_icon">
                <a href="#" class="tooltip">
                    <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                    <span>
                        <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/image or logo.png")" alt="" />
                        <p class="user_cont">
                            You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                        </p>
                    </span></a>
            </div></div>





        @using (Ajax.BeginForm("Update", "Iphone", new AjaxOptions
        {
            HttpMethod = "POST",
            LoadingElementId = "loader",
            OnSuccess = "successwelcome"

        }))
        {
            <div style="top: 80%; position: absolute; left: 50%; display: none" id="loader">
                <img src="@Url.Content("~/images/ajax-loader.gif")" />
            </div>
            @Html.HiddenFor(model => model.sponsor)
            @Html.HiddenFor(model => model.Sponsor_ID)
            <div class="upload_view">
                 <br />
               <p class="horizental-line">
                   <img src="@Url.Content("~/images/line.jpg")" alt="Horizentalline" />

               </p>
                 <div class="up_data">
                <label>TEXT</label></div>
                <div class="up_data">
                    <label>
                        Company Name:</label>
                    @Html.TextBoxFor(model => model.icompany_name)
                    <div class="info_icon">
                        <a href="#" class="tooltip">
                            <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                            <span>
                                <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/name line1.png")" alt="" />
                                <p class="user_cont">
                                    You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                                </p>
                            </span></a>
                    </div>
                </div>
                <div class="up_data">
                    <label>
                        Tag Line:</label>
                    @Html.TextAreaFor(model => model.itagline)
                    <div class="info_icon">
                        <a href="#" class="tooltip">
                            <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                            <span>
                                <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/message line.png")" alt="" />
                                <p class="user_cont">
                                    You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                                </p>
                            </span></a>
                    </div>
                </div>
                <div class="up_data">
                    <label>
                        Your Name:</label>
                    @Html.TextBoxFor(model => model.iname_line)
                    <div class="info_icon">
                        <a href="#" class="tooltip">
                            <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                            <span>
                                <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/name line 2.png")" alt="" />
                                <p class="user_cont">
                                    You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                                </p>
                            </span></a>
                    </div>
                </div>
                <div class="up_data">
                    <label>
                        Phone:</label>
                    @Html.TextBoxFor(model => model.iphone_number)
                    <div class="info_icon">
                        <a href="#" class="tooltip">
                            <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                            <span>
                                <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/phone line.png")" alt="" />
                                <p class="user_cont">
                                    You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                                </p>
                            </span></a>
                    </div>
                </div>
                <div class="up_data">
                    <label>
                        Email:</label>
                    @Html.TextBoxFor(model => model.iemail_address)
                  
                    <div class="info_icon">
                        <a href="#" class="tooltip">
                            <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                            <span>
                                <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/email line.png")" alt="" />
                                <p class="user_cont">
                                    You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                                </p>
                            </span>
                    </div>
                </div>
                <div class="up_data">
                    <label>
                        Web Address:</label>
                    @Html.TextBoxFor(model => model.iwebsite)
                    @*@Html.ValidationMessageFor(model => model.iwebsite)*@
                    <div class="info_icon">
                        <a href="#" class="tooltip">
                            <img src="@Url.Content("~/images/info_icon.png")" alt="" />
                            <span>
                                <img class="callout" src="@Url.Content("~/images/mobileApp/tool tips iphone/welcome screen/website line.png")" alt="" />
                                <p class="user_cont">
                                    You can upload an image that will be displayed here, and it will also be displayed
                                                                on the Admin Link, My Screen, Setup Done Screen, and your Banner Message.
                                </p>
                            </span></a>
                    </div>
                </div>
            </div>
            <div class="save_btn">
                <input type="submit" value="" id="btnSubmit" />

            </div>
        }
        </div>
    </div>


    @*<script type="text/javascript">
    $(document).ready(function () {

      
       $('#fileupload').fileupload({
              dataType: 'json',
              url: '/Iphone/UploadFiles',
              autoUpload: true,
              formData: { id: $('#Sponsor_ID').val() },
            
              done: function (e, data) {
                  alert(data.result.name);
                $('.file_name').html(data.result.name);
                $('.file_type').html(data.result.type);
                $('.file_size').html(data.result.size);
                $("#imglogo").attr("src", data.result.imagepath);

            }
       }).on('fileuploadprogressall', function (e, data) {
          
            var progress = parseInt(data.loaded / data.total * 100, 10);
            $('.progress .progress-bar').css('width', progress + '%');
        });
    }); $("#imglogo").attr("src", data.result.imagepath);
</script>*@

    <script type="text/javascript">
        $(document).ready(function () {

            $('#fileupload').fileupload({
                dataType: 'json',
                url: '/Iphone/UploadFiles',
                autoUpload: true,
                formData: { id: $('#Sponsor_ID').val() },
                done: function (e, data) {

                    $('.file_name').html(data.result.name);
                    $('.file_type').html(data.result.type);
                    $('.file_size').html(data.result.size);
                    $('.file_imglogo').html('sponsor_iphone_images/' + data.result.path);
                    $("#imglogo").attr("src", '../sponsor_iphone_images/Defalt.png');
                    $("#imglogo").attr("src", "../sponsor_iphone_images/" + data.result.path + "?" +@DateTime.Now.Ticks.ToString() +"");
                    $("#divRestore").css("display", "block");
                    $("#loaderdefaultimage").css("display", "none");
                    $('.progress').hide();
                }
            }).on('fileuploadprogressall', function (e, data) {
                $('.progress').show();
                var progress = parseInt(data.loaded / data.total * 100, 10);
                $('.progress .progress-bar').css('width', progress + '%');
            });

           
        });
        $_blockDelete = false;
        $('#btnDefaultImageRestore').die('click').live('click', function () {
                var rconfirm = confirm('Are you sure?');
                if (rconfirm) {
                    $('#form0').submit();
                }
        });
    </script>
